;;; af
;;; Language: R5RS

(define (square a) (* a a))

(define (sum-of-squares a b) (+ (square a) (square b)))

(define (sum-of-squares-of-two-larger a b c)
  (if (or (> a b) (> a c)) 
      (sum-of-squares a (if (> b c) b c))
      (sum-of-squares b c)))

; > (sum-of-squares-of-two-larger 1 2 3)
; 13
; > (sum-of-squares-of-two-larger 2 1 3)
; 13
; > (sum-of-squares-of-two-larger 2 3 1)
; 13